﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.WebPages;

using Script.Net.Scripts;


namespace Script.Net.Mvc
{
	public static class ScriptFileExtensions
	{
		public static IHtmlString ScriptFile(this HtmlHelper html, string alias, string src)
		{
			return ScriptFile(html, alias, null, src);
		}

		public static IHtmlString ScriptFile(this HtmlHelper html, string alias, IEnumerable<string> dependsOnAliases, string src)
		{
			ScriptFactory.Repository.CreateScript(new ScriptFile 
			{ 
				Alias = alias, 
				Dependencies = dependsOnAliases,
				Path = WebPageContext.Current.Page.Href(src) 
			});

			return new MvcHtmlString("");
		}
		
	}
}
